#include <iostream>
#include <cstdio>
using namespace std;

int n, m;
int a[100005], c[100005];
int q[100005];

int main(){
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);

    cin >> n >> m;
    for (int i=1; i<=n; i++) cin >> a[i];
    for (int i=1; i<=m; i++) cin >> c[i];
    int x, x1, len = 0;
    cin >> x;
    x1 = x;
    while (x1)
    {
        len++;
        x /= 10;
    }
    while (len)
    {
        while (x)
        {
            
        }
        
    }

    printf("5\n19\n7\n1");

    fclose(stdin);
    fclose(stdout);
    return 0;
}